package com.ias.agdis_r.bean.task;

import java.util.HashMap;
import java.util.LinkedHashMap;

import com.ias.agdis_r.bean.document.Document;

/**
 * 非航班任务Bean
 * 
 * @author zhangsc
 */
public class NFTask {
	
		//任务相关信息内容
		private NFTaskInfo taskInfo;
		//任务号
		private String TNB; 
		//任务进程状态
		private String PID;
		
		//任务服务标注MAP
		private LinkedHashMap<String, TaskServiceLabel> serviceLabelMap;
		//任务单据MAP
		private LinkedHashMap<String, Document> documentMap;
		//任务进程MAP
		private LinkedHashMap<String,TaskProcess> processMap;
			
		public NFTaskInfo getTaskInfo() {
			
			if(taskInfo == null)
			{
				taskInfo = new NFTaskInfo();
			}
			return taskInfo;
		}

		public void setTaskInfo(NFTaskInfo info) {
			this.taskInfo = info;
		}
		
		public String getTNB() {
			return TNB;
		}

		public void setTNB(String tNB) {
			TNB = tNB;
		}

		public String getPID() {
			return PID;
		}

		public void setPID(String pID) {
			PID = pID;
		}
		
		public HashMap<String,TaskProcess> getProcessMap() {
			
			if(processMap == null)
			{
				processMap = new LinkedHashMap<String,TaskProcess>();
			}
			return processMap;
		}

	 public HashMap<String, TaskServiceLabel> getServiceLabelMap() {
			
			if(serviceLabelMap == null)
			{
				serviceLabelMap = new LinkedHashMap<String, TaskServiceLabel>();
			}
			return serviceLabelMap;
		}
		
	  public HashMap<String, Document> getDocumentMap() {
			
			if(documentMap == null)
			{
				documentMap = new LinkedHashMap<String, Document>();
			}
			return documentMap;
		}
		
	  public  void setProcessMap(LinkedHashMap<String,TaskProcess> processMap) {
			
			this.processMap = processMap;
		}

	  public void setServiceLabelMap(LinkedHashMap<String, TaskServiceLabel> serviceLabelMap) {
			
			this.serviceLabelMap = serviceLabelMap;
		}
		
	   public void setDocumentMap(LinkedHashMap<String, Document> documentMap) {
			
			this.documentMap = documentMap;
		}

	   public Document getDocument(String tag) {
			
			if(documentMap == null)
			{
				documentMap = new LinkedHashMap<String, Document>();
			}
			return documentMap.get(tag);
		}
		
		public TaskProcess getProcess(String tag) {
			
			if(processMap == null)
			{
				processMap = new LinkedHashMap<String,TaskProcess>();
			}
			return processMap.get(tag);
		}

		public TaskServiceLabel getServiceLabel(String tag) {
			
			if(serviceLabelMap == null)
			{
				serviceLabelMap = new LinkedHashMap<String, TaskServiceLabel>();
			}
			return serviceLabelMap.get(tag);
		}
		
		/**
		 * 添加服务标注信息
		 * @param tag
		 * @param serviceLabel
		 */
		public void putServiceLabel(String tag,TaskServiceLabel serviceLabel) {
			
			if(serviceLabelMap == null)
			{
				serviceLabelMap = new LinkedHashMap<String, TaskServiceLabel>();
			}
			serviceLabelMap.put(tag, serviceLabel);
		}

		/**
		 * 添加单据信息
		 * @param tag
		 * @param document
		 */
		public void putDocument(String tag,Document document) {

			if(documentMap == null)
			{
				documentMap = new LinkedHashMap<String, Document>();
			}
			documentMap.put(tag, document);
		}
		/**
		 * 添加任务进程信息
		 * @param tag
		 * @param process
		 */
		public void putProcess(String tag,TaskProcess process) {

			if(processMap == null)
			{
				processMap = new LinkedHashMap<String,TaskProcess>();
			}
			processMap.put(tag, process);
		}
		
		/**
		 * 删除服务标注信息
		 * @param tag
		 * @param serviceLabel
		 */
		public void delServiceLabel(String tag) {
			
			if(serviceLabelMap == null)
			{
				serviceLabelMap = new LinkedHashMap<String, TaskServiceLabel>();
			}
			serviceLabelMap.remove(tag);
		}

		/**
		 * 删除单据信息
		 * @param tag
		 * @param document
		 */
		public void delDocument(String tag) {

			if(documentMap == null)
			{
				documentMap = new LinkedHashMap<String, Document>();
			}
			documentMap.remove(tag);
		}
		
		/**
		 * 删除任务进程信息
		 * @param tag
		 * @param serviceLabel
		 */
		public void delProcess(String tag) {
			
			if(processMap == null)
			{
				processMap = new LinkedHashMap<String,TaskProcess>();
			}
			processMap.remove(tag);
		}
}
